export default {
  name: 'BMapMarker',
  methods: {
    async getDataAsync() {
      if (Array.isArray(this.$attrs.data)) {
        this.dataList = this.$attrs.data;
      } else if (typeof this.$attrs.fetch === 'function') {
        this.dataList = await this.$attrs.fetch();
      }
      this.$emit('loaded', this.dataList);
    },
  },
  created() {
    this.dataList = [];
    this.getDataAsync().catch();
  },
  render() {
    return null;
  },
};
